<template>
  <div class="app-container">
    <header>
      <h1>我的应用</h1>
    </header>
    <main>
      <router-view></router-view>
    </main>
    <footer>
      <nav>
        <router-link to="/home" :class="{ active: $route.name === 'home' }">首页</router-link>
        <router-link to="/article" :class="{ active: $route.name === 'article' }">文章</router-link>
        <router-link to="/notify" :class="{ active: $route.name === 'notify' }">通知</router-link>
        <router-link to="/user" :class="{ active: $route.name === 'user' }">我的</router-link>

      </nav>
    </footer>
  </div>
</template>

<script setup lang="ts">
</script>

<style scoped>
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: #f8f9fa;
  text-align: center;
}

main {
  flex: 1;
  padding: 20px;
}

footer {
  background-color: #f8f9fa;
  padding: 0px 20px;
  text-align: center;
}

nav {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

nav a {
  display: inline-block;
  text-decoration: none;
  color: #333;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 0.3s ease;
}

nav a:hover,
nav .active {
  background-color: #ddd;
  font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
  nav a {
    padding: 10px;
    font-size: 14px;
  }

  header {
    padding: 10px;
  }

  main {
    padding: 10px;
  }

  footer {
    padding: 10px;
  }
}
</style>